package org.bwapi.bridge.model;

import java.util.Set;

import org.apache.commons.collections15.Transformer;
import org.bwapi.bridge.swig.ForceSet;
import org.bwapi.bridge.swig.ForceSetIterator;
import org.bwapi.bridge.swig.SWIGTYPE_p_std__setT_BWAPI__Force_p_t;
import org.cretz.swig.collection.NativeSet;


/**
 * Force
 * 
 * @see <a href="http://code.google.com/p/bwapi/wiki/Force">Force</a>
 * 
 * @author Chad Retz
 */
public class Force {
	private static final Transformer<Force, org.bwapi.bridge.swig.Force> FROM = 
		new Transformer<Force, org.bwapi.bridge.swig.Force>() {
			@Override
			public org.bwapi.bridge.swig.Force transform(Force force) {
				return force.getForce();
			}
		};
		
	private static final Transformer<org.bwapi.bridge.swig.Force, Force> TO = 
		new Transformer<org.bwapi.bridge.swig.Force, Force>() {
			@Override
			public Force transform(org.bwapi.bridge.swig.Force force) {
				return new Force(force);
			}
		};
	
	static Set<Force> newSet(SWIGTYPE_p_std__setT_BWAPI__Force_p_t nativeSet) {
		return new NativeSet<Force, org.bwapi.bridge.swig.Force>(
				org.bwapi.bridge.swig.Force.class, ForceSetIterator.class, 
				nativeSet, ForceSet.class, FROM, TO);
	}

	private final org.bwapi.bridge.swig.Force force;
	
	Force(org.bwapi.bridge.swig.Force force) {
		this.force = force;
	}
	
	org.bwapi.bridge.swig.Force getForce() {
		return force;
	}
	
	public String getName() {
		return force.getName();
	}
	
	public Set<Player> getPlayers() {
		return Player.newSet(force.getPlayers());
	}
}
